package com.ficus.road.maintain.core.model.coverage;

import lombok.Data;

import java.util.Date;

/**
 * @author xiawen yang
 * @date 2022/3/16 下午2:50
 */
@Data
public class UnitCoverageDayZH {

    private double worklengthall;

    private double worklength;

    private String managesectionid;

    private String statistype;

    private String cyclenum;

    private String departid;

    private double coverday;

    public UnitCoverageDay convert2UnitCoverageDay(UnitCoverageDayZH zh, Date date, String dateStr) {
        return UnitCoverageDay.builder()
                .id(zh.getManagesectionid() + zh.getDepartid() + dateStr)
                .unitId(zh.getManagesectionid())
                .departId(zh.getDepartid())
                .cycleNum(zh.getCyclenum())
                .realCover(zh.getWorklength())
                .shouldCover(zh.getWorklengthall())
                .date(dateStr)
                .dayCoverage(zh.getCoverday())
                .lastModificationTime(date)
                .build();
    }
}
